package com.cxm.helper.controller;

import com.cxm.helper.pojo.dto.CategoryListDTO;
import com.cxm.helper.service.CategoryService;
import com.cxm.helper.util.ResponseEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: chenximeng
 * @date: 2022/11/23 14:08
 */
@RestController
@RequestMapping("/category")
public class CategoryController {

    @Autowired
    CategoryService categoryService;

    @PostMapping("/list")
    public ResponseEntity list(@RequestBody CategoryListDTO categoryListDTO){
        return ResponseEntity.ok(categoryService.listCategory(categoryListDTO));
    }
}
